from matplotlib import pyplot as plt

colors = {'r','g','b','y','k','c','m'}
marks  = {'o','D','h','H','.','p'}

def generate_hdr_battery(numhdr,numcols,generator,normalizer):
    """"Generates an HDR Battery
    
        Keyword arguments:
        numhdr     -- number of HDRs to be generated
        numcols    -- number of columns/dimensions per HDR
        generator  -- the HDRGenerator to be used (non-null)
        normalizer -- the HDRNormalizer to be used (non-null)
    """
    battery = []
    for x in range(numhdr):
        src = numcols if x == 0 else battery[x-1]
        battery.append(normalizer.normalize_hdr(generator.generate_hdr(src)))
    return battery

def plot_hdr_battery(battery):
    """Plot an HDR Battery onto a single Matplotlib figure"""
    label_gen = ("{0}{1}".format(c,m) for m in marks for c in colors)
    labels = [next(label_gen) for v in range(len(battery))]
    x_series = range(len(battery[0]))
    for x in range(len(battery)):
        #plt.plot(x_series,battery[x],labels[x])
        plt.plot(x_series,battery[x])
    plt.show()
